<!--  -->
<template>
  <div class="singer_cotainer">
    <h1 class="title">收藏的专辑<span class="album_count">({{count}})</span></h1>
    <div class="all">
      <ul>
        <li v-for="(item, index) in singerList" :key="index" @click="toDetail(item.id)">
          <div class="rank">{{ index + 1  }}</div>
          <div class="img"><img :src="item.picUrl" alt="" /></div>
          <div class="name">{{ item.name }}</div>
          <span class="alias">专辑：{{item.albumSize}}</span>
          <div class="count">mv：{{item.mvSize}}</div>
        </li>
      </ul>
    </div>
    <div v-if="loginStatus!=='true'">
      <el-empty description="暂无收藏歌手"></el-empty>
    </div>
  </div>
</template>

<script>
import { getSingerCollect } from 'util/collect.js'
import { mapGetters } from 'vuex'

export default {
  name: '',
  data() {
    return {
      count: 0,
      singerList: []
    }
  },
  created() {
    this.getSingerCollect()
  },
  computed: {
    ...mapGetters('userInfo', ['loginStatus'])
  },
  methods: {
    async getSingerCollect() {
      let { data } = await getSingerCollect()
      //   console.log(data)
      this.singerList = data.data
      this.count = data.count
    },
    toDetail(id) {
      this.$router.push('/singerDetail/' + id)
    }
  }
}
</script>

<style scoped lang='less'>
.title {
  line-height: 50px;
  padding: 0 40px;
  .album_count {
    font-size: 10px;
    font-weight: normal;
    color: rgb(194, 190, 190);
  }
}
.all ul li {
  padding-left: 20px;
  display: flex;
  height: 80px;
  background: #f9f9f9;
  align-items: center;
}
.all ul li:nth-child(2n) {
  background: #fff;
}
.all ul li:hover {
  background: #f0f1f2;
}
.all ul li .rank {
  width: 30px;
  text-align: center;
  font-size: 20px;
  color: #ddd;
}
.all ul li .img {
  width: 60px;
  height: 60px;
  margin-left: 30px;
  margin-right: 10px;
}
.all ul li .img img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}
.all ul li .name {
  flex: 1;
  font-size: 15px;
}
.count {
  flex: 1;
  text-align: center;
  color: #969697;
  font-size: 12px;
}
.all ul li .alias {
  flex: 1;
  color: #969697;
  font-size: 13px;
}
.alias .by {
  font-size: 10px;
  margin-right: 4px;
  color: #d2c3d3;
}
.all ul li .score {
  width: 150px;
  font-size: 12px;
  color: rgb(128, 120, 120);
}
.all ul li {
  padding-left: 20px;
  display: flex;
  height: 80px;
  background: #f9f9f9;
  align-items: center;
}
.all ul li:nth-child(2n) {
  background: #fff;
}
.all ul li:hover {
  background: #f0f1f2;
}
.all ul li .rank {
  width: 30px;
  text-align: center;
  font-size: 20px;
  color: #ddd;
}
.all ul li .img {
  width: 60px;
  height: 60px;
  margin-left: 30px;
  margin-right: 10px;
}
.all ul li .img img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
}
.all ul li .name {
  flex: 1;
  font-size: 15px;
}
.count {
  flex: 1;
  text-align: center;
  color: #969697;
  font-size: 12px;
}
.all ul li .alias {
  flex: 1;
  color: #969697;
  font-size: 13px;
}
.alias .by {
  font-size: 10px;
  margin-right: 4px;
  color: #d2c3d3;
}
.all ul li .score {
  width: 150px;
  font-size: 12px;
  color: rgb(128, 120, 120);
}
</style>